<template>
  <Header :msg="state.header" />
  <router-view v-slot="{ Component }">
    <keep-alive>
      <component :is="Component" />
    </keep-alive>
  </router-view>
  <Footer />
</template>

<script setup>
import { reactive } from "vue";
import Header from "./components/Box/Header/Header.vue";
import Footer from "./components/Box/Footer/Footer.vue";

// 双向绑定数据
const state = reactive({
  header: { from: "", code: "", msg: "" },
});

// 页面回传数据
const fnInfoMation = (val) => {
  if (val.from === "Login") state.header = val;
  if (val.from === "Qlib") state.header = val;
};
</script>

<style>
#app {
  font-family: Avenir, Helvetica, Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-align: center;
  color: #2c3e50;
  position: relative;
}
</style>
